<section class="clearfix" ng-controller="adminGlobalCtrl">
    <div class="page-header">
            <h4>网站设置</h4>
    </div>

    <ul class="nav nav-tabs">
        <li class="active">
            <a href="#" ng-click="setTab('tab1')" data-toggle="tab">基本设置</a>
        </li>
        <li>
            <a href="#" ng-click="setTab('tab2')" data-toggle="tab">参数设置</a>
        </li>
        <li>
            <a href="#" ng-click="setTab('tab3')" data-toggle="tab">缓存设置</a>
        </li>
        <li>
            <a href="#" ng-click="setTab('tab4')" data-toggle="tab">SMTP设置</a>
        </li>
    </ul>

    <div class="tab-content" ng-switch on="switchTab">
        <div class="active" ng-switch-when="tab1">
            <form name="globalEdit" class="form-horizontal">
                <div class="control-group">
                    <label class="control-label">
                    网站域名：
                    </label>
                    <div class="controls">
                    <input type="text" name="domain" ng-model="global.domain" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    网站网址[含http://]：
                    </label>
                    <div class="controls">
                    <input type="url" name="url" ng-model="global.url" />
                    <span class="text-error" ng-show="globalEdit.url.$error.url">
                    无效的URL地址！
                    </span>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    网站Logo：
                    </label>
                    <div class="controls">
                    <input type="text" name="logo" ng-model="global.logo" />
                    <img ng-src="{{global.logo}}" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    管理员Email[不公开]：
                    </label>
                    <div class="controls">
                    <input type="email" name="email" ng-model="global.email" />
                    <span class="text-error" ng-show="globalEdit.email.$error.email">无效的Email!</span>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    网站名称：
                    </label>
                    <div class="controls">
                    <input type="text" name="title" ng-model="global.title" ng-maxlength="20"/>
                    <span class="text-error" ng-show="globalEdit.title.$error.maxlength">
                    网站名称不能超过20个字符!
                    </span>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    网站副标题：
                    </label>
                    <div class="controls">
                    <input type="text" name="description" ng-model="global.description" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    网站Meta标题[SEO]：
                    </label>
                    <div class="controls">
                    <input type="text" name="metatitle" ng-model="global.metatitle" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    网站Meta描述[SEO]：
                    </label>
                    <div class="controls">
                    <textarea ng-model="global.metadesc" class="input-block-level">
                    </textarea>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    网站Meta关键词[SEO]：
                    </label>
                    <div class="controls">
                    <textarea ng-model="global.keywords" class="input-block-level">
                    </textarea>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    搜索引擎机器人：
                    </label>
                    <div class="controls">
                    <textarea ng-model="global.robots" class="input-block-level">
                    </textarea>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    用户注册：
                    </label>
                    <div class="controls">
                    <button class="btn btn-small" ng-class="setClass(global.register)" ng-click="global.register=!global.register">{{!global.register | boolean}}</button>
                    <span class="help-inline text-info">{{global.register | boolean}}了注册</span>
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls" ng-show="editSave">
                        <button class="btn btn-primary" ng-click="submit()">保存</button>
                        <button class="btn btn-success" ng-click="reset()">重置</button>
                    </div>
                </div>
            </form>
        </div>

        <div class="" ng-switch-when="tab2">
            <form name="globalEdit" class="form-horizontal">
                <div class="control-group">
                    <label class="control-label">
                    文章允许最多标签数量：
                    </label>
                    <div class="controls">
                    <input type="number" name="ArticleTagsMax" ng-model="global.ArticleTagsMax"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    用户允许最多标签数量：
                    </label>
                    <div class="controls">
                    <input type="number" name="UserTagsMax" ng-model="global.UserTagsMax"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    标题最短字节数：
                    </label>
                    <div class="controls">
                    <input type="number" name="TitleMinLen" ng-model="global.TitleMinLen"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    标题最长字节数：
                    </label>
                    <div class="controls">
                    <input type="number" name="TitleMaxLen" ng-model="global.TitleMaxLen"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    摘要最长字节数：
                    </label>
                    <div class="controls">
                    <input type="number" name="SummaryMaxLen" ng-model="global.SummaryMaxLen"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    文章最短字节数：
                    </label>
                    <div class="controls">
                    <input type="number" name="ContentMinLen" ng-model="global.ContentMinLen"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    文章最长字节数：
                    </label>
                    <div class="controls">
                    <input type="number" name="ContentMaxLen" ng-model="global.ContentMaxLen"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    用户名最短字节数：
                    </label>
                    <div class="controls">
                    <input type="number" name="UserNameMinLen" ng-model="global.UserNameMinLen"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    用户名最长字节数：
                    </label>
                    <div class="controls">
                    <input type="number" name="UserNameMaxLen" ng-model="global.UserNameMaxLen"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    用户积分系数：
                    </label>
                    <div class="controls">
                    <input type="text" name="UsersScore" ng-model="global.UsersScore" ng-list="/[,，\s]/"/>
                    <span class="text-info help-block">[评论×<strong>{{global.UsersScore[0]}}</strong>
                    ，文章×<strong>{{global.UsersScore[1]}}</strong>，关注×<strong>{{global.UsersScore[2]}}</strong>
                    ，粉丝×<strong>{{global.UsersScore[3]}}</strong>，文章热度×<strong>{{global.UsersScore[4]}}</strong>，
                    注册时长天数×<strong>{{global.UsersScore[5]}}</strong>]</span>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    评论提升系数：
                    </label>
                    <div class="controls">
                    <input type="text" name="ArticleStatus" ng-model="global.ArticleStatus" ng-list="/[,，\s]/" />
                    <span class="text-info help-block">[评论的评论数达到<strong>{{global.ArticleStatus[0]}}</strong>时，自动提升正常文章，
                    达到<strong>{{global.ArticleStatus[1]}}</strong>时，自动提升为推荐文章]</span>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    文章热度系数：
                    </label>
                    <div class="controls">
                    <input type="text" name="ArticleHots" ng-model="global.ArticleHots" ng-list="/[,，\s]/"/>
                    <span class="text-info help-block">[访问+<strong>{{global.ArticleHots[0]}}</strong>，支持/反对±<strong>
                    {{global.ArticleHots[1]}}</strong>，评论+<strong>{{global.ArticleHots[2]}}</strong>，收藏+
                    <strong>{{global.ArticleHots[3]}}</strong>，推荐+<strong>{{global.ArticleHots[4]}}</strong>]</span>
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls" ng-show="editSave">
                        <button class="btn btn-primary" ng-click="submit()">保存</button>
                        <button class="btn btn-success" ng-click="reset()">重置</button>
                    </div>
                </div>
            </form>
        </div>

        <div class="" ng-switch-when="tab3">
            <form name="globalEdit" class="form-horizontal">
                <div class="control-group">
                    <label class="control-label">
                    用户缓存容量：
                    </label>
                    <div class="controls">
                    <input type="number" name="userCache" ng-model="global.userCache"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    文章缓存容量：
                    </label>
                    <div class="controls">
                    <input type="number" name="articleCache" ng-model="global.articleCache"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    评论缓存容量：
                    </label>
                    <div class="controls">
                    <input type="number" name="commentCache" ng-model="global.commentCache"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    文章列表缓存容量：
                    </label>
                    <div class="controls">
                    <input type="number" name="listCache" ng-model="global.listCache"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    标签缓存容量：
                    </label>
                    <div class="controls">
                    <input type="number" name="tagCache" ng-model="global.tagCache"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    合集缓存容量：
                    </label>
                    <div class="controls">
                    <input type="number" name="collectionCache" ng-model="global.collectionCache"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    消息缓存容量：
                    </label>
                    <div class="controls">
                    <input type="number" name="messageCache" ng-model="global.messageCache"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    分页导航缓存：
                    </label>
                    <div class="controls">
                    <input type="text" name="paginationCache" ng-model="global.paginationCache" ng-list="/[,，\s]/"/>
                    <span class="text-info help-block">[有效期<strong>{{global.paginationCache[0]}}</strong>秒
                    ，最大容量<strong>{{global.paginationCache[1]}}</strong>]</span>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    操作限时缓存：
                    </label>
                    <div class="controls">
                    <input type="number" name="TimeInterval" ng-model="global.TimeInterval"/>
                    <span class="text-info help-block">秒，搜索、用户添加文章或评论等限制操作的最小时间间隔，最小值为3秒</span>
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls" ng-show="editSave">
                        <button class="btn btn-primary" ng-click="submit()">保存</button>
                        <button class="btn btn-success" ng-click="reset()">重置</button>
                    </div>
                </div>
            </form>
        </div>

        <div class="" ng-switch-when="tab4">
            <form name="globalEdit" class="form-horizontal">
                <div class="control-group">
                    <label class="control-label">
                    服务器地址：
                    </label>
                    <div class="controls">
                    <input type="text" name="smtpHost" ng-model="global.smtp.host" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    服务器端口：
                    </label>
                    <div class="controls">
                    <input type="number" name="smtpPort" ng-model="global.smtp.port" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    SMTP用户名：
                    </label>
                    <div class="controls">
                    <input type="text" name="smtpAuthUser" ng-model="global.smtp.auth.user"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    SMTP用户密码：
                    </label>
                    <div class="controls">
                    <input type="password" name="smtpAuthPass" ng-model="global.smtp.auth.pass"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    发送人名称：
                    </label>
                    <div class="controls">
                    <input type="text" name="smtpSenderName" ng-model="global.smtp.senderName"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    发送人Email：
                    </label>
                    <div class="controls">
                    <input type="text" name="smtpSenderEmail" ng-model="global.smtp.senderEmail"/>
                    <span class="text-info">
                    部分SMTP服务器要求其与用户名一致
                    </span>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">
                    是否开启SSL：
                    </label>
                    <div class="controls">
                    <button class="btn btn-small" ng-class="setClass(global.smtp.secureConnection)" ng-click="global.smtp.secureConnection=!global.smtp.secureConnection">{{!global.smtp.secureConnection | boolean}}</button>
                    <span class="help-inline text-info">{{global.smtp.secureConnection | boolean}}了SSL</span>
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls" ng-show="editSave">
                        <button class="btn btn-primary" ng-click="submit()">保存</button>
                        <button class="btn btn-success" ng-click="reset()">重置</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</section>
